/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

h2 {
    color: #444;
    margin-bottom: 20px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

/* 表单样式 */
.form-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

.student-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.form-actions {
    display: flex;
    gap: 10px;
    grid-column: 1 / -1;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 表格样式 */
.list-section {
    margin-top: 30px;
}

.students-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
}

.students-table th {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 16px 20px;
    font-size: 1.1em;
    border: 2px solid #388E3C;
}

.students-table td {
    border: 2px solid #e0e0e0;
    padding: 14px 18px;
    text-align: left;
    color: #333;
    transition: all 0.3s ease;
}

.students-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.students-table tr:nth-child(odd) {
    background-color: #ffffff;
}

.students-table tr:hover {
    background-color: #e3f2fd;
    transform: translateY(-1px);
}

.students-table tr:hover td {
    border-color: #2196F3;
}

.actions-cell {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* 加载和错误状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
    font-weight: bold;
}

.error {
    text-align: center;
    padding: 20px;
    color: #d32f2f;
    background-color: #ffebee;
    border: 2px solid #f44336;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: bold;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.delete-name {
    color: #f44336;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 10px;
    }
    
    .student-form {
        grid-template-columns: 1fr;
    }
    
    .students-table {
        font-size: 14px;
    }
    
    .students-table th,
    .students-table td {
        padding: 10px 12px;
    }
    
    .actions-cell {
        flex-direction: column;
    }
    
    h1 {
        font-size: 1.8em;
    }
}